import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

/**
 * Write a description of class upgrade here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class upgrade extends Actor
{
    int type;
    
    public upgrade(int u){
        type=u;       
    }
    
    protected void addedToWorld(World world)
    {
        if(type==1 || type==2)setImage(((it) getWorld()).getSword());  
        if(type==3 || type==4)setImage(((it) getWorld()).getGun()); 
    } 
    
    
    public void act() 
    {}  
    
    public int check(){
        ((it) getWorld()).removeObject(this); 
        return type;        
    }
    
    
    
    
    
}
